/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.ManagerUser;
import org.apache.ibatis.jdbc.SQL;

public class ManagerUserSqlProvider {

    /* @mbggenerated */
    public String insertSelective(ManagerUser record) {
        return new SQL() {
            {
                INSERT_INTO("manager_user");

                if (record.getId() != null) {
                    VALUES("id", "#{id,jdbcType=INTEGER}");
                }

                if (record.getUsername() != null) {
                    VALUES("username", "#{username,jdbcType=VARCHAR}");
                }

                if (record.getPasswd() != null) {
                    VALUES("passwd", "#{passwd,jdbcType=VARCHAR}");
                }

                if (record.getSalt() != null) {
                    VALUES("salt", "#{salt,jdbcType=VARCHAR}");
                }

                if (record.getSuppId() != null) {
                    VALUES("supp_id", "#{suppId,jdbcType=INTEGER}");
                }

                if (record.getState() != null) {
                    VALUES("state", "#{state,jdbcType=TINYINT}");
                }

                if (record.getCreateUser() != null) {
                    VALUES("create_user", "#{createUser,jdbcType=INTEGER}");
                }

                if (record.getCreateTime() != null) {
                    VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
                }

                if (record.getUpdUser() != null) {
                    VALUES("upd_user", "#{updUser,jdbcType=INTEGER}");
                }

                if (record.getUpdateTime() != null) {
                    VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
                }

            }
        }.toString();
    }

    /* @mbggenerated */
    public String updateByPrimaryKeySelective(ManagerUser record) {
        return new SQL() {
            {
                UPDATE("manager_user");

                if (record.getUsername() != null) {
                    SET("username = #{username,jdbcType=VARCHAR}");
                }

                if (record.getPasswd() != null) {
                    SET("passwd = #{passwd,jdbcType=VARCHAR}");
                }

                if (record.getSalt() != null) {
                    SET("salt = #{salt,jdbcType=VARCHAR}");
                }

                if (record.getSuppId() != null) {
                    SET("supp_id = #{suppId,jdbcType=INTEGER}");
                }

                if (record.getState() != null) {
                    SET("state = #{state,jdbcType=TINYINT}");
                }

                if (record.getCreateUser() != null) {
                    SET("create_user = #{createUser,jdbcType=INTEGER}");
                }

                if (record.getCreateTime() != null) {
                    SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
                }

                if (record.getUpdUser() != null) {
                    SET("upd_user = #{updUser,jdbcType=INTEGER}");
                }

                if (record.getUpdateTime() != null) {
                    SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
                }

                WHERE("id = #{id,jdbcType=INTEGER}");

            }
        }.toString();
    }
}